home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / LGP250S1.ZIP / src / libgplus.5 / libgplus / configur.in < prev    next >
Text File  |  1993-10-15  |  5KB  |  142 lines

  1. # This file is a shell script fragment that supplies the information
  2. # necessary to tailor a template configure script into the configure
  3. # script appropriate for this directory.  For more information, check
  4. # any existing configure script.
  5.  
  6. configdirs="genclass no-stream old-stream src tests gperf utils etc test-install"
  7. srctrigger=libg++.texi
  8. srcname="GNU C++ Class Library"
  9.  
  10. # per-host:
  11.  
  12. # per-target:
  13.  
  14. package_makefile_frag=Make.pack
  15.  
  16.     echo "# Warning this fragment is automatically generated" >temp.mt
  17.     rootme=`pwd`
  18.     export rootme
  19.     CC=${CC-`if [ -f ${rootme}/../gcc/xgcc ] ; \
  20.             then echo ${rootme}/../gcc/xgcc -B${rootme}/../gcc/ ; \
  21.             else echo gcc ; fi`}
  22.     CONFIG_NM=${CONFIG_NM-nm}
  23.  
  24.     # The Bourne shell writes "command not found" to /dev/tty, so if we get
  25.     # a usage message on stderr, we have the program.
  26.     #
  27.     # ksh and zsh write "command not found" to stderr, but test -n does not
  28.     # want any output if there is no program.  So we use the `type' builtin
  29.     # instead for them (and bash).
  30.     if test "$RANDOM" = "$RANDOM"; then
  31.       checkfor='test -n "`$checkprog $checkargs 2>&1`"'
  32.     else
  33.       checkfor='type $checkprog >/dev/null'
  34.     fi
  35.  
  36.     echo checking for ranlib
  37.     checkprog=ranlib checkargs=/dev/null
  38.     if [ -n "$RANLIB" ] ; then
  39.         echo "RANLIB = ${RANLIB}" >>temp.mt
  40.     elif (eval $checkfor) >/dev/null 2>&1 ; then
  41.         # Use default value set in Makefile
  42.         echo "# RANLIB = ranlib" >>temp.mt
  43.     else
  44.         echo "RANLIB = true" >>temp.mt
  45.     fi
  46.  
  47.  
  48.     # Check if we have reasonable include files:
  49. #cat >temp.c <<'EOF'
  50. ##include <unistd.h>
  51. ##include <stdarg.h>
  52. ##include <stdio.h>
  53. ##include <string.h>
  54. ##include <stdlib.h>
  55. #int call() { return 0; }
  56. #int main()
  57. #{
  58. #  call(fclose);
  59. #  call(rename);
  60. #  return call(memcmp);
  61. #}
  62. #EOF
  63. #    if [ -s "`${CC} -o temp temp.c 2>&1`" ] ; then true
  64. #    else
  65. #        # Include files look tolerable
  66. #        echo 'WRAP_C_INCLUDES =' >>temp.mt
  67. #    fi
  68.  
  69.     # Some recent systems wrap extern "C" around function declarations
  70.     # in the system C header files.  Unfortunately, some systems
  71.     # (such as Irix) miss the extern "C" in curses.h, say,
  72.     # though they have it in *most* of the header files,
  73.     # so it is hard to test for this automatically.
  74. #    echo "(checking if C include files have 'extern" '"C"'"')"
  75. #    echo '#include <unistd.h>' >temp.c
  76. #    if ${CC} -E -D__cplusplus temp.c | grep 'extern "C"' 2>&1 >/dev/null ; then
  77. #        echo 'WRAP_C_INCLUDES =' >>temp.mt
  78. #    else
  79.  
  80.             echo '
  81. # If the C include files are C++-ready (with extern "C"), uncomment next line:
  82. # WRAP_C_INCLUDES =' >>temp.mt
  83.  
  84. echo '
  85. # Flags to pass to gen-params when building _G_config.h.
  86. # For example: G_CONFIG_ARGS = size_t="unsigned long"
  87. G_CONFIG_ARGS =' >>temp.mt
  88.  
  89. rm -f temp.c temp.o temp
  90.  
  91. case "${target}" in
  92.   i[34]86-*-linux) my_target=linux ;;
  93.   *-*-solaris2*)   my_target=solaris2 ;;
  94.   *-*-solaris)     my_target=solaris2 ;;
  95.   *-*-*)           my_target=${target_cpu}
  96. esac
  97.  
  98. target_makefile_frag=config/${my_target}.mt
  99. if [ -f ${srcdir}/${target_makefile_frag} ] ; then
  100.   echo "Appending ${srcdir}/${target_makefile_frag} to target-mkfrag"
  101.   echo "# Following fragment copied from ${srcdir}/${target_makefile_frag}" >>temp.mt
  102.   cat ${srcdir}/${target_makefile_frag} >>temp.mt
  103. fi
  104.  
  105. ${moveifchange} temp.mt target-mkfrag
  106.  
  107. TOLIBGXX=
  108. ALL='$(TARGETLIB) rest-in-parallel'
  109. MOSTLYCLEAN='*.o core \#* temp.c stamp-$(TARGETLIB) dummy.out dummy.[Cc] TMP a.out'
  110. CLEAN='.stmp-* _G_config.h $(TARGETLIB)'
  111. DISTCLEAN='config.status Makefile target-mkfrag'
  112. INFO_FILES=libg++
  113. INFO_SUBDIRS='$(SUBDIRS)'
  114.  
  115. # If cross-compiling, don't configure gperf or test-install, since
  116. # they do not work (gperf and utils will get built by the target
  117. # compiler, which is confusing, and test-install will try to execute
  118. # programs built by the target compiler, which can not be done).
  119. if [ ${host} != ${target} ] ; then
  120.   configdirs=`echo ${configdirs} | sed -e 's/gperf//' -e 's/test-install//' -e 's/utils//'`
  121. fi
  122.  
  123. (. ${srcdir}/config.shared) >${package_makefile_frag}
  124.  
  125. # post-target:
  126.  
  127. # If cross-compiling, don't build gperf or the utils.  They
  128. # will get built by the target compiler, which is confusing.
  129. # We cannot test the installation.  We install in $(tooldir).
  130. if [ ${host} != ${target} ] ; then
  131.     sed \
  132.     -e 's|INSTALLDIR.*=.*$|INSTALLDIR = $(tooldir)/lib|' \
  133.     -e 's|GPERF.*=.*gperf|GPERF = # gperf|' \
  134.     -e 's|TEST_INSTALL[     ]*=.*$|TEST_INSTALL = |' \
  135.     -e 's|UTILS[     ]*=.*$|UTILS =|' \
  136.     -e 's|LIBIBERTY =.*$|LIBIBERTY = xiberty|' \
  137.     Makefile >Makefile.tem
  138.     mv -f Makefile.tem Makefile
  139. fi
  140.  
  141. rm -f ${package_makefile_frag}
  142.